package com.fanshuai2.niuke.search.dfs;
import java.util.*;

public class PokerCalc24 {

    static class StringValue {
        String v;
        void setValue(String v) {
            this.v = v;
        }
    }

    static int getRank(String poker) {
        char c = poker.charAt(0);
        if (c >= '2' && c <= '9') {
            return c - '0';
        } else if (c == 'J') {
            return 11;
        } else if (c == 'Q') {
            return 12;
        } else if (c == 'K') {
            return 13;
        } else if (c == 'A') {
            return 1;
        } else if (poker.equals("10")) {
            return 10;
        }
        return 0;
    }

    static String getPoker(int rank) {
        if (rank >= 2 && rank <= 10) {
            return String.valueOf(rank);
        }
        if (rank == 11) {
            return "J";
        }
        if (rank == 12) {
            return "Q";
        }
        if (rank == 13) {
            return "K";
        }
        if (rank == 1) {
            return "A";
        }
        return "";
    }

    static String calc(String poker) {
        if (poker.contains("joker") || poker.contains("JOKER")) {
            return "ERROR";
        }
        String[] arr = poker.split(" ");
        int[] pokerArr = new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            pokerArr[i] = getRank(arr[i]);
        }
        boolean[] visited = new boolean[arr.length];

        StringValue v = new StringValue();
        if (dfs(pokerArr, visited, 0, 0, "", v)) {
            return  v.v;
        } else {
            return "NONE";
        }
    }

    static boolean dfs(int[] poker, boolean[] visited, int n,
                       int result, String exp, StringValue finalResult) {
        if (n == poker.length) {
            if (result == 24) {
                finalResult.setValue(exp);
                return true;
            } else {
                return false;
            }
        }

        for (int i = 0; i < poker.length; i++) {
            if (!visited[i]) {
                visited[i] = true;
                if (n == 0) {
                    if (dfs(poker, visited, n + 1, poker[i],
                            exp + getPoker(poker[i]),finalResult)) {
                        return true;
                    }
                } else {
                    if (dfs(poker, visited, n + 1, result + poker[i],
                            exp + "+" + getPoker(poker[i]), finalResult) ||

                            dfs(poker, visited, n + 1, result - poker[i],
                                    exp + "-" + getPoker(poker[i]), finalResult) ||

                            dfs(poker, visited, n + 1, result * poker[i],
                                    exp + "*" + getPoker(poker[i]), finalResult) ||

                            dfs(poker, visited, n + 1, result / poker[i],
                                    exp + "/" + getPoker(poker[i]), finalResult)
                    ) {
                        return true;
                    }
                }
                visited[i]= false;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        while (in.hasNextLine()) {
            String poker = in.nextLine();
            System.out.println(calc(poker));
        }
    }
}
